Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow escaped quotes in tag parameters #124

Merged
merged 4 commits into from
May 13, 2024
Merged

Conversation

roya1v
Copy link
Contributor

@roya1v roya1v commented May 13, 2023

These changes are now available in 1.10.6

Allows escaped quotes in tag parameters so you can do something like #myCustomTag("this \"thing\" is cool")

Solves #122

@roya1v roya1v marked this pull request as ready for review May 18, 2023 18:35
@0xTim
Copy link
Member

0xTim commented May 19, 2023

@roya1v why not use \" for an escaped quote?

@roya1v
Copy link
Contributor Author

roya1v commented May 22, 2023

@0xTim that was my initial idea. As far as I tried we don't distinguish between escaped and not-escaped quotes. I tried to dig deeper but couldn't find a place in leaf-kit to amend this behaviour. Correct me please if I'm wrong
Screenshot 2023-05-22 at 12 12 45
Screenshot 2023-05-22 at 12 13 02

Now that I think about it, two slashes might work, lmk if you would prefer that
Screenshot 2023-05-22 at 19 34 22

@0xTim
Copy link
Member

0xTim commented Jun 13, 2023

Ah I see, I think the issue you're having is that Swift will automatically count the \, whereas if it was created in a template directly \" should work fine so I think \\ works in this case

@0xTim 0xTim linked an issue Jun 13, 2023 that may be closed by this pull request
@roya1v
Copy link
Contributor Author

roya1v commented Jun 30, 2023

Hey @0xTim sorry I don't know if you didn't see it or didn't have time to take a look. I've pushed the change to \\

@roya1v roya1v requested review from 0xTim and gwynne as code owners May 8, 2024 21:23
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.51%. Comparing base (f6a08a1) to head (0d51e90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   82.09%   81.51%   -0.59%     
==========================================
  Files          25       25              
  Lines        2603     2510      -93     
==========================================
- Hits         2137     2046      -91     
+ Misses        466      464       -2     
Files Coverage Δ
Sources/LeafKit/LeafLexer/LeafLexer.swift 97.76% <100.00%> (-0.08%) ⬇️

... and 16 files with indirect coverage changes

@0xTim 0xTim added the semver-patch Internal changes only label May 13, 2024
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry it's taken so long to review!

@0xTim 0xTim changed the title Add quote escaping to tag parameters Allow escaped quotes in tag parameters May 13, 2024
@0xTim 0xTim merged commit 547e48c into vapor:main May 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to add quotes into stringLiteral parameters
3 participants